package com.es.www.original.staticProxy;

import com.es.www.original.Image;

/**
 * @Created by michangtao
 * @Date 2022/4/28 17:04
 * @Description
 */
public class ProxyImage implements Image {

    private RealImage realImage;

    private String name;


    public ProxyImage(String name) {
        this.name = name;
    }

    @Override
    public String display() {
        if(realImage == null){
            realImage = new RealImage(name);
        }
        return realImage.display();
    }
}
